<template>
  <el-container>
    <common-table v-if="pageData.viewMode==='list'" ref="table" />
    <common-form v-if="pageData.viewMode==='info'" ref="form" />
  </el-container>
</template>

<script>
import CommonTable from "@/components/TkCommonPage/components/CommonTable.vue"
import CommonForm from "@/components/TkCommonPage/components/CommonForm.vue"

export default {
  name: "FormPage",
  components: { CommonForm, CommonTable },
  inject: ["pageData"],
  methods: {
    /**
     * 更新表单
     * @param key
     * @param value
     */
    updateFormData(key, value) {
      this.$refs.form.updateFormData(key, value)
    }
  }
}
</script>

<style scoped lang="scss">

</style>
